package com.jinxin.platform.cdsmsmgr.exception;

import lombok.Getter;
import org.springframework.http.HttpStatus;

/**
 * @Author: haochen
 * @Description:  用户自定义异常
 * @Date:  2020/11/25 15:19
 **/
@Getter
public class BusinessRuntimeException extends RuntimeException {
    private int code;

    private String message;

    public BusinessRuntimeException() {
        super();
    }
    
    public BusinessRuntimeException(String message) {
        super(message);
        this.code = HttpStatus.INTERNAL_SERVER_ERROR.value();
        this.message = message;
    }

    public BusinessRuntimeException(int code, String message) {
        super(message);
        this.code = code;
        this.message = message;
    }

    public BusinessRuntimeException(int code, String message, Throwable cause) {
        super(message, cause);
        this.code = code;
        this.message = message;
    }
}
